import HYRequest from "./request";
import { BASE_URL, TIME_OUT } from "./config"

export const hyRequest = new HYRequest({
    baseURL: BASE_URL,
    timeout: TIME_OUT
})

export const hyRequest2 = new HYRequest({
    baseURL: "http://codercba.com:8000",
    timeout: 1000,
    interceptors: {
        requestSuccessFn: (config) => {
            console.log("homeM的请求成功的拦截")
            return config
        },
        requestFailFn: (err) => {
            console.log("homeM的请求失败的拦截")
            return err
        },
        responseSuccessFn: (res) => {
            console.log("homeM的响应成功的拦截")
            return res
        },
        responseFailFn: (err) => {
            return err
        },
    }
})

